package org.grayrabbit.cms.service.system.impl;

import java.util.HashMap;
import java.util.Map;

import org.grayrabbit.cms.entity.Config;


public class ConfigContext {
	private static Map<String,Config> configMap;
	static boolean UPDATE_FLAG = true;	//更新标识
	static Object lock = new Object();
	
	public static void put(Config config){
		assert(config!=null);
		assert(config.getConfigAttrKey()!=null);
		if(configMap==null)
			configMap = new HashMap<String, Config>();
		configMap.put(config.getConfigAttrKey(), config);
	}
	
	public static Config get(String key){
		if(configMap==null)
			return null;
		return configMap.get(key);
	}

	public static void remove(String key) {
		if(configMap==null)
			return;
		configMap.remove(key);
	}
}
